package cn.wolfcode.web.controller;

import cn.wolfcode.domain.Business;
import cn.wolfcode.domain.SystemDictionary;
import cn.wolfcode.qo.QueryObject;
import cn.wolfcode.service.IBusinessService;
import cn.wolfcode.service.ISystemDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {
    @Autowired
    private IBusinessService businessService;

    @Autowired
    private ISystemDictionaryService systemDictionaryService ;

    @RequestMapping("/index")
    public String list(Model model){
        Business business = businessService.selectByMain();
        model.addAttribute("business",business);

        List<SystemDictionary> systemDictionaries = systemDictionaryService.selectByBs("business");
        model.addAttribute("systemDictionaries",systemDictionaries);

        return "index" ;
    }


}
